import 'package:flutter/material.dart';

void main() {
  // 1. 启动项目, 并传入根组件实例对象
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        // 1.1 导航
        appBar: AppBar(
          backgroundColor: Colors.pink,
          title: const Center(
            child: Text(
              'Hello Flutter',
              style: TextStyle(
                  color: Colors.white,
                  fontSize: 30,
                  fontWeight: FontWeight.w400),
            ),
          ),
        ),
        // 1.2 主体部分
        body: const Center(
          child: Text(
            'Flutter Knowledge',
            textDirection: TextDirection.ltr,
            style: TextStyle(
                fontSize: 40.0,
                color: Colors.pink,
                fontWeight: FontWeight.w900),
          ),
        ),
      ),
    );
  }
}
